package main

import (
	"log"
	time "time"
)

func main() {

	// 每1秒触发一次tick
	tick := time.Tick(1 * time.Second)
	go func() {
		for {
			select {
			case t := <-tick:
				log.Println("协程阻塞1s后，收到票据， t=", t)
			}
		}
	}()

	select {
	case <-time.After(10 * time.Second):
		log.Println("主协程阻塞10s后，退出")
	}
}
